package io.renren.modules.customer.service;

import com.baomidou.mybatisplus.extension.service.IService;
import io.renren.common.enums.CommonProcessStatus;
import io.renren.common.utils.PageUtils;
import io.renren.modules.customer.entity.MessageRequestEntity;

import java.util.List;
import java.util.Map;

/**
 * 
 *
 * @author Sean
 * @email seanla@qq.com
 * @date 2020-03-17 19:29:25
 */
public interface MessageRequestService extends IService<MessageRequestEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 批量发送短信
     * @param batchNumber
     * @param ids
     * @param currentUserId
     * @param template 短信模板
     */
    void batchSendMessages(String batchNumber, Long[] ids, Long currentUserId, String template);

    List<String> getPhoneNumbersWithPendingRequests(List<String> phones);

    /**
     * 查找需要发送短信的请求
     * @param batchSize 批次大小
     * @return
     */
    List<MessageRequestEntity> getPendingMessageRequestEntities4Messaging(int batchSize);

    /**
     * 查找需要发送短信的请求
     * @param batchSize 批次大小
     * @param maxRetryCount 最大尝试次数
     * @return
     */
    List<MessageRequestEntity> getFailMessageRequestEntities4MessagingRetry(int batchSize, int maxRetryCount);

    /**
     * 根据第三方消息id获取请求实体
     * @param messageId
     * @param mobilePhone
     * @return
     */
    MessageRequestEntity getByVendorMessageIdAndPhone(String messageId, String mobilePhone);
}

